package com.youlai.boot.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.youlai.boot.common.annotation.DataPermission;
import com.youlai.boot.system.model.bo.UserBO;
import com.youlai.boot.system.model.entity.Article;
import com.youlai.boot.system.model.query.UserPageQuery;
import com.youlai.boot.system.model.vo.ArticleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.youlai.boot.system.model.bo.ArticleBO;
import com.youlai.boot.system.model.query.ArticlePageQuery;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    /**
     * 获取用户分页列表
     *
     * @param page
     * @param queryParams 查询参数
     * @return
     */
//    @DataPermission(deptAlias = "a")
    Page<ArticleBO> listPagedArticles(Page<ArticleBO> page, ArticlePageQuery queryParams);
    Page<ArticleBO> fllistPagedArticles(Page<ArticleBO> page, ArticlePageQuery queryParams);
    Page<ArticleBO> keyWordsPagedArticles(Page<ArticleBO> page, ArticlePageQuery queryParams);

    ArticleBO getArticleForm(Long articleId);

    List<ArticleBO> getRelateArticle(Long articleId, int flid);

    List<ArticleBO> getHotArticle(ArticlePageQuery queryParams);
    List<ArticleBO> getTjArticle();
    List<ArticleBO> getTjArticlev1();
    List<ArticleBO> getFlHotArticle(int flid);
    List<ArticleBO> getFlTjArticle(int flid);
    List<ArticleBO> getFlZxArticle(int flid);
    List<ArticleBO> getIndexHotArticle(int parent_id);

    ArticleBO getArticlePrevData(Long articleId,int flid);

    ArticleBO getArticleNextData(Long articleId,int flid);

    boolean viewArticle(Long articleId);
}
